package com.quanta.edaily.mapper;

import com.quanta.edaily.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    User getUserById(Integer id);
    User getUserByEDailyId(String edailyId);
    User getUserByPhone(String phone);
    User getUserByName(String name);
    List<User> getAll();
    List<User> findPage(@Param("pageNum") int pageNum, @Param("pageSize")int pageSize);
    int insertUser(User user); // 4 necessary fields
    int updateUserById(User user);
    int updateTokenById(@Param("id")Integer id, @Param("token") String token);
    int updatePasswordById(@Param("id")Integer id, @Param("old") String oldPassword,@Param("new") String newPassword);
    int deleteUserById(Integer id);
    Integer countAllUser();
    List<User> getPublished();
}
